home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / resources / guiapplication.r next >
Encoding:
Text File  |  2000-09-28  |  5.2 KB  |  209 lines

  1. /*
  2.     File:        GUIApplication.r
  3.  
  4.     Contains:    Application is a simple application environment.
  5.                   GUIApplication contains the default window oriented application resources.
  6.                   Rez -rd -o TargetApplication GUIApplication.r -append
  7.  
  8.     Written by:     
  9.  
  10.     Copyright:    Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
  11.  
  12.                 You may incorporate this Apple sample source code into your program(s) without
  13.                 restriction. This Apple sample source code has been provided "AS IS" and the
  14.                 responsibility for its operation is yours. You are not permitted to redistribute
  15.                 this Apple sample source code as "Apple sample source code" after having made
  16.                 changes. If you're going to re-distribute the source, we require that you make
  17.                 it clear in the source that the code was descended from Apple sample source
  18.                 code, but that you've made changes.
  19.  
  20.     Change History (most recent first):
  21.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  22.                 
  23.  
  24. */
  25. // INCLUDES
  26. #include "SysTypes.r"
  27. #include "Types.r"
  28. #include "ApplicationResources.h"
  29.  
  30.  
  31. // _________________________________________________________________________________________________________ //
  32. // MEMORY
  33.  
  34. #define kPrefSize    314                // k of memory preferred
  35. #define kMinSize     314                // k of memory minimally  
  36.  
  37.  
  38.  
  39. // _________________________________________________________________________________________________________ //
  40. // MENU HANDLING (MBAR, MENU)
  41.  
  42. // MBAR: If you have more menu entries, add these in after the default ones
  43. resource 'MBAR' (mAppMBAR, preload) {
  44.     { mApple, mFile };
  45. };
  46.  
  47.  
  48. // MENU RESOURCES
  49.  
  50. resource 'MENU' (mApple, preload) {
  51.     mApple, textMenuProc,
  52.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  53.     enabled, apple,
  54.     {
  55.         "About Application…",
  56.             noicon, nokey, nomark, plain;
  57.         "-",
  58.             noicon, nokey, nomark, plain
  59.     }
  60. };
  61.  
  62.  
  63.  
  64. resource 'MENU' (mFile, preload) {
  65.     mFile, textMenuProc,
  66.     0b0000000000000000000100000000000,    /* enable Quit only, program enables others */
  67.     enabled, "File",
  68.     {
  69.         "New",
  70.             noicon, "N", nomark, plain;
  71.         "Open",
  72.             noicon, "O", nomark, plain;
  73.         "-",
  74.             noicon, nokey, nomark, plain;
  75.         "Close",
  76.             noicon, "W", nomark, plain;
  77.         "Save",
  78.             noicon, "S", nomark, plain;
  79.         "Save As…",
  80.             noicon, nokey, nomark, plain;
  81.         "Revert",
  82.             noicon, nokey, nomark, plain;
  83.         "-",
  84.             noicon, nokey, nomark, plain;
  85.         "Page Setup…",
  86.             noicon, nokey, nomark, plain;
  87.         "Print…",
  88.             noicon, nokey, nomark, plain;
  89.         "-",
  90.             noicon, nokey, nomark, plain;
  91.         "Quit",
  92.             noicon, "Q", nomark, plain
  93.     }
  94. };
  95.  
  96.  
  97. // _________________________________________________________________________________________________________ //
  98. // APPLE EVENT SUPPORT
  99.  
  100.  
  101.  
  102.  
  103. resource 'aedt' (kCoreAEDispatchTable) {{            // Minimum for AppleEvent aware application
  104.     'aevt', 'ansr', cAppleEventReply;
  105.     'aevt', 'oapp', cNewCommand;
  106.     'aevt', 'odoc', cOpenCommand;
  107.     'aevt', 'quit', cQuitCommand;
  108.     'aevt', 'pdoc', cPrintCommand;
  109.     }
  110. };
  111.  
  112. resource 'aedt' (kGUIAEDispatchTable) {{            // Basic GUI AE framework support
  113.     'aevt', 'abou', cAboutCommand;
  114.     }
  115. };
  116.  
  117.  
  118. // _________________________________________________________________________________________________________ //
  119. // USER INTERACTION MODULES (Alerts, Dialog boxes…)
  120.  
  121. /* this ALRT and DITL are used as an ASSERT error screen */
  122.  
  123.  
  124. resource 'ALRT' (kUserAlert, purgeable) {
  125.     {40, 20, 189, 468},
  126.     100,
  127.     {    /* array: 4 elements */
  128.         /* [1] */
  129.         OK, visible, silent,
  130.         /* [2] */
  131.         OK, visible, silent,
  132.         /* [3] */
  133.         OK, visible, silent,
  134.         /* [4] */
  135.         OK, visible, silent
  136.     },
  137.     alertPositionMainScreen
  138. };
  139.  
  140. resource 'DITL' (kUserAlert, purgeable) {
  141.     {    /* array DITLarray: 3 elements */
  142.         /* [1] */
  143.         {122, 360, 142, 440},
  144.         Button {
  145.             enabled,
  146.             "OK"
  147.         },
  148.         /* [2] */
  149.         {9, 48, 115, 439},
  150.         StaticText {
  151.             disabled,
  152.             "Error: ^0."
  153.         },
  154.         /* [3] */
  155.         {8, 8, 40, 40},
  156.         Icon {
  157.             disabled,
  158.             2
  159.         }
  160.     }
  161. };
  162.  
  163.  
  164. // _________________________________________________________________________________________________________ //
  165. // VERS RESOURCES
  166.  
  167. resource 'vers' (1) {
  168.     0x01, 0x00, release, 0x00,
  169.     verUS,
  170.     "1.00",
  171.     "1.00, Copyright © 1993 Apple Computer, Inc."
  172. };
  173.  
  174. // SIZE -----------------------------------------------------------------------------------
  175.  
  176. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  177.  
  178. resource 'SIZE' (-1) {
  179.     dontSaveScreen,
  180.     acceptSuspendResumeEvents,
  181.     enableOptionSwitch,
  182.     canBackground,                // we can background; we don't currently, but our sleep value
  183.                                 // guarantees we don't hog the Mac while we are in the background
  184.     doesActivateOnFGSwitch,        // this says we do our own activate/deactivate; don't fake us out
  185.     backgroundAndForeground,    // this is definitely not a background-only application!
  186.     dontGetFrontClicks,            // change this is if you want "do first click" behavior like the Finder
  187.     ignoreAppDiedEvents,        // essentially, I'm not a debugger (sub-launching)
  188.     is32BitCompatible,            // this app works OK in 32-bit address space
  189.     isHighLevelEventAware,        // Apple Events support
  190.     localAndRemoteHLEvents,        // Apple Events support
  191.     reserved,
  192.     reserved,
  193.     reserved,
  194.     reserved,
  195.     reserved,
  196.     kPrefSize * 1024,
  197.     kMinSize * 1024    
  198. };
  199.  
  200.  
  201. // _________________________________________________________________________________________________________ //
  202.  
  203.  
  204. /*    Change History (most recent last):
  205.   No        Init.    Date        Comment
  206.   1            khs        11/15/92    New file
  207.   2            khs        1/14/93        Cleanup
  208. */
  209.